# encoding: utf-8
"""
@author: yangwei
@contact: yangchen211@126.com
@time: 2021/8/22 3:39 下午
@file: feishu_api.py
@desc: 
"""
import requests
from requests import request

from service.api.http_api import HttpAPI


class FeiShuAPI(HttpAPI):

    def __init__(self,token):
        self.token = token
        
    def get_token(self):
        pass

    def request(self, method, url, *args, **kwargs):
        # if 'headers' in kwargs:
        #     kwargs['headers']['Authorization] = f'Bearer {self.get_token()}'
        r = requests.request(
            method=method,
            url=url,
            headers={
                'Authorization-Type': f'Bearer {self.get_token()}'
            },
            **kwargs
        )
        print(r.status_code)
        return r.json()